<template>
	<view>
		<z-paging ref="paging" v-model="list" @query="getPage" :auto="false">
			<cu-custom slot="top" :bgColor="'bg-'+ theme.themeColor" :isBack="true">
				<block slot="backText">返回</block>
				<block slot="content">分销订单</block>
			</cu-custom>
			<view>
				<view v-for="(item,index) in list" class="bg-white radius padding margin-sm">
					<view class="flex justify-between">
						<view class="flex">
							<view class="cu-avatar round"
								:style="'background-image:url(' + item.userInfo.avatarUrl + ')'">
							</view>
							<view class="padding-lr">
								<view class="text-xl">
									{{item.userInfo.nickName}}
								</view>
								<view>
									{{item.userInfo.phone}}
								</view>
							</view>

						</view>
						<view>
							{{item.status == '1' ? '冻结中' :'已解冻'}}<text
								class="text-price text-xl text-red">{{item.totalAmount}}</text>
						</view>
					</view>
					<view class="margin-top">
						<view>
							下单时间：{{item.orderInfo.paymentTime}}
						</view>
						<view>
							订单编号：<text>
								{{item.orderInfo.orderNo}}
							</text>
						</view>
						<view>
							订单金额：<text class="text-price text-red">
								{{item.orderInfo.paymentPrice}}
							</text>
						</view>
					</view>

				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	import {
		getPage
	} from '@/api/distributionorder.js';
	export default {

		data() {
			return {
				theme: getApp().globalData.theme,
				list: []
			}
		},
		onLoad() {
			getApp().initPage().then(res => {
				this.$refs.paging.reload();
			})
		},
		methods: {
			/**
			 * 分页查询
			 */
			getPage(pageNo, pageSize) {
				getPage({
					current: pageNo,
					size: pageSize,
					descs: 'create_time',
				}).then(res => {
					this.$refs.paging.complete(res.data.records);
				});
			},
		}
	}
</script>

<style>
</style>
